<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<div class="ibox-content ibox-con">
	<div class="current-state-pad">
		<table cellpadding="0" cellspacing="0" border="0"
			class="infor-table">
			<tr>
				<td align="right"><label class="control-label np">业务部门：</label>
				</td>
				<td>
					<div class="control-div np" id="">
						<label id="orgName"></label>
					</div>
				</td>
				<td align="right"><label class="control-label np">信贷专员：</label>
				</td>
				<td>
					<div class="control-div np" id="">
						<label id="salersman"></label>
					</div>
				</td>

			</tr>

		</table>
	</div>
	<div class="business-manwife clickSlide" style="cursor: pointer;">
		主借人信息&nbsp;&nbsp;<i class="glyphicon glyphicon-chevron-down"></i>
	</div>
	<div class="business-padding" style="display: none;">
		<table cellpadding="0" cellspacing="0" border="0"
			class="infor-table">
			<tr>
				<td align="right"><label class="control-label np">客户姓名：</label>
				</td>
				<td>
					<div class="control-div np" id="">
						<label id="name"></label>
					</div>
				</td>

				<td align="right"><label class="control-label np">身份证号码：</label>
				</td>
				<td>
					<div class="control-div np" id="">
						<label id="idno"></label>
					</div>
				</td>

				<td align="right"><label class="control-label np">性别：</label>
				</td>

				<td>
					<div class="control-div np" id="">
						<label id="sex"></label>
					</div>
				</td>

			</tr>


			<tr>
				<td align="right"><label class="control-label np">家庭电话：</label>
				</td>
				<td>
					<div class="control-div np" id="">
						<label id="familyTel"></label>
					</div>
				</td>

				<td align="right"><label class="control-label np">手机号码：</label>
				</td>
				<td>
					<div class="control-div np" id="">
						<label id="tel1"></label>
					</div>
				</td>


				<td align="right"><label class="control-label np">公司电话：</label>
				</td>
				<td>
					<div class="control-div np" id="">
						<label id="companyTel"></label>
					</div>
				</td>
			</tr>

			<tr>
				<td align="right"><label class="control-label np">现住电话：</label>
				</td>

				<td>
					<div class="control-div np" id="">
						<label id="nowTel"></label>
					</div>
				</td>

				<td align="right"><label class="control-label np">汽车牌照：</label>
				</td>
				<td>
					<div class="control-div np" id="">
						<label id="licensePlate"></label>
					</div>
				</td>

				<td align="right"><label class="control-label np">汽车品牌：</label>
				</td>
				<td>
					<div class="control-div np" id="">
						<label id="carBrand"></label>
					</div>
				</td>

			</tr>

			<tr>
				<td align="right"><label class="control-label np">汽车车系：</label>
				</td>
				<td>
					<div class="control-div" id="">
						<label id="carSeries"></label>
					</div>
				</td>

				<td align="right"><label class="control-label np">汽车车型：</label>
				</td>

				<td colspan="3">
					<div class="control-div" id="">
						<label id="carModel"></label>
					</div>
				</td>
			</tr>

			<tr>
				<td align="right"><label class="control-label np">贷款金额：</label>
				</td>
				<td>
					<div class="control-div" id="">
						<label id="signLoanAmount"></label>
					</div>
				</td>

				<td align="right"><label class="control-label np">贷款期限：</label>
				</td>
				<td>
					<div class="control-div" id="">
						<label id="loanMonth"></label>
					</div>
				</td>
				<td align="right"><label class="control-label np">月还款额：</label>
				</td>
				<td>
					<div class="control-div" id="">
						<label id="amountMonthly"></label>
					</div>
				</td>
			</tr>

			<tr>
				<td align="right"><label class="control-label np">贷款利率：</label>
				</td>

				<td>
					<div class="control-div" id="">
						<label id="companyRate"></label>
					</div>
				</td>

				<td align="right"><label class="control-label np">放贷日期：</label>
				</td>
				<td>
					<div class="control-div" id="">
						<label id="fddateDeal"></label>
					</div>
				</td>

				<td align="right"><label class="control-label np">银行逾期额：</label>
				</td>
				<td>
					<div class="control-div" id="">
						<label id="balance"></label>
					</div>
				</td>
			</tr>

			<tr>
				<td align="right"><label class="control-label np">银行逾期天数：</label>
				</td>
				<td>
					<div class="control-div" id="">
						<label id="dateNumOverdue"></label>
					</div>
				</td>
				<td align="right"><label class="control-label np">代偿金额：</label>
				<!-- 代偿打款表获取 --></td>
				<td>
					<div class="control-div" id="">
						<label id="bAmount"></label>
					</div>
				</td>
			</tr>

			<tr>
				<td align="right"><label class="control-label np">理赔金额：</label>
				<!-- 从理赔表获取 --></td>
					<td>
						<div class="control-div" id="">
							<label id="cAmount"></label>
						</div>
					</td>
					<td align="right">
				</tr>

			</table>
		</div>
	</div>
	<div class="business-manwife clickSlide" style="cursor: pointer;">
		其他信息&nbsp;&nbsp;<i class="glyphicon glyphicon-chevron-down"></i>
	</div>
	<div class="business-padding" style="display: none;">
		<table cellpadding="0" cellspacing="0" border="0" class="infor-table" id="danbaorenInfo"> </table>
	</div>
	
	<%@include file="/jsp/comm_js_include.jsp"%>
	<script type="text/javascript">
		$(function(){
			$(".clickSlide").click(function(){
				$(this).siblings(".business-padding").slideToggle();
				$(this).children("i").toggleClass("glyphicon glyphicon-chevron-down glyphicon glyphicon-chevron-up");
			});
			
		})	
		
		 var getCarInfo=function(){
	 		$.dpAjax({
	 			show:false,
	    		url:'${basePath}/YwBusinessCommonController/getCommonBusinessWithBuyersInfo',
	    		data:{"busiId":$.getUrlData("busiId")},
    			success: function(datas){
	    				  if(datas.ywInfo!=null){
	    					  $("#orgName").html(datas.ywInfo.orgName);
	    					  document.getElementById("salersman").innerText=datas.ywInfo.name;
	    				  }
	    				  if(datas.otherBuyers!=null){
			          		var html="";
  			          		for(var i=0;i<datas.otherBuyers.length;i++){
								if(datas.otherBuyers[i].carManType=="01"){
	  			          		  html+='<tr><td align="right"><label class="control-label np">配偶：</label></td>';
	    						  html+='<td align="right"><div class="control-div np" id=""><label>'+datas.otherBuyers[i].name+'</label></div></td>';
	    						  html+='<td align="right"><label class="control-label np">身份证号：</label></td>';
	    						  html+='<td align="right"><div class="control-div np" id=""><label>'+datas.otherBuyers[i].idno+'</label></div></td>';
	    						  html+='<td align="right"><label class="control-label np">手机号码：</label></td>';
	    						  html+='<td align="right"><div class="control-div np" id=""><label>'+datas.otherBuyers[i].tel1+'</label></div></td></tr>';
	  			          		}else if(datas.otherBuyers[i].carManType=="02"){
	  			          		  html+='<tr><td align="right"><label class="control-label np">担保人：</label></td>';
	    						  html+='<td align="right"><div class="control-div np" id=""><label>'+datas.otherBuyers[i].name+'</label></div></td>';
	    						  html+='<td align="right"><label class="control-label np">身份证号：</label></td>';
	    						  html+='<td align="right"><div class="control-div np" id=""><label>'+datas.otherBuyers[i].idno+'</label></div></td>';
	    						  html+='<td align="right"><label class="control-label np">手机号码：</label></td>';
	    						  html+='<td align="right"><div class="control-div np" id=""><label>'+datas.otherBuyers[i].tel1+'</label></div></td></tr>';
	  			          		} 
  			          			
  			          		}
  			          		$("#danbaorenInfo").append(html);
	    				  }
	    				  if(datas.buyers!=null){
	    					document.getElementById("name").innerText=datas.buyers.name;
	  			          	document.getElementById("idno").innerText=datas.buyers.idno;
	  			          	document.getElementById("familyTel").innerText=datas.buyers.familyTel;
	  			          	document.getElementById("tel1").innerText=datas.buyers.tel1;
	  			        	document.getElementById("sex").innerText=datas.buyers.sex=="01"?"男":"女";
	  			          	document.getElementById("companyTel").innerText=datas.buyers.companyTel;
	  			          	document.getElementById("nowTel").innerText=datas.buyers.nowTel;
	  			          	document.getElementById("licensePlate").innerText=datas.buyers.licensePlate;
	  			          	document.getElementById("carBrand").innerText=datas.buyers.nameCarBrand;
	  			          	document.getElementById("carSeries").innerText=datas.buyers.nameCarSeries;
	  			          	document.getElementById("carModel").innerText=datas.buyers.nameCarModel;
	  			          	document.getElementById("signLoanAmount").innerText=datas.buyers.signLoanAmount;
	  			          	document.getElementById("loanMonth").innerText=datas.buyers.loanMonth;
	  			          	document.getElementById("amountMonthly").innerText=datas.buyers.amountMonthly;
	  			          	document.getElementById("companyRate").innerText=datas.buyers.companyRate;
	  			          	document.getElementById("signLoanAmount").innerText=datas.buyers.signLoanAmount;
	  			          	document.getElementById("dateNumOverdue").innerText=datas.buyers.dateNumOverdue;
	  			          	document.getElementById("bAmount").innerText=datas.buyers.bAmount;
	  			          	document.getElementById("cAmount").innerText=datas.buyers.cAmount;
	  			          	document.getElementById("balance").innerText=datas.buyers.balance; 
	  			          	document.getElementById("fddateDeal").innerText=formateStringDate(datas.buyers.dateDeal);  
	  			          	var obj="";
	  			            obj+='<tr><td align="right"><label class="control-label np">紧急联络人1：</label></td>';
	  			        	obj+='<td align="right"><div class="control-div np" id=""><label>'+datas.buyers.contact1+'</label></div></td>';
	  			      	    obj+='<td align="right"><label class="control-label np">手机号码：</label></td>';
	  			    	    obj+='<td align="right"><div class="control-div np" id=""><label>'+datas.buyers.contact1Tel1+'</label></div></td>';
	  			    	    obj+='<td align="right"><label class="control-label np">关系：</label></td>';
	  			    	    obj+='<td><div class="control-div np" id=""><label id="contact1Relation">'+datas.buyers.contact1RelationDisplay+'</label></div></td></tr>';
	  			    	    
	  			    	    obj+='<tr><td align="right"><label class="control-label np">紧急联络人2：</label></td>';
	  			        	obj+='<td align="right"><div class="control-div np" id=""><label>'+datas.buyers.contact2+'</label></div></td>';
	  			      	    obj+='<td align="right"><label class="control-label np">手机号码：</label></td>';
	  			    	    obj+='<td align="right"><div class="control-div np" id=""><label>'+datas.buyers.contact2Tel1+'</label></div></td>';
	  			    	    obj+='<td align="right"><label class="control-label np">关系：</label></td>';
	  			    	    obj+='<td><div class="control-div np" id=""><label id="contact1Relation">'+datas.buyers.contact2RelationDisplay+'</label></div></td></tr>';
	  			    	    $("#danbaorenInfo").append(obj);
	    				  }
	  			          	
                 }
	    	});
	 	}
	</script>